package com.ty.day1.home;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/14 18:04
 */
public class Person {
    String name;
    Integer age;
    Pet pet;
    public void introduce(){
        System.out.println("我叫"+name+"今年"+age+"自重庆，喜欢唱、跳、rap、篮球,还有一个宠物"+pet.name);
    }
    public void play(){
        System.out.println("和宠物玩耍");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", pet=" + pet +
                '}';
    }
}
